package com.ruoyi.system.service.impl;

import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.communityCodeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YbssAddressMapper;
import com.ruoyi.system.domain.YbssAddress;
import com.ruoyi.system.service.IYbssAddressService;

/**
 * 地址查看Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-08
 */
@Service
public class YbssAddressServiceImpl implements IYbssAddressService {
    @Autowired
    private YbssAddressMapper ybssAddressMapper;


    @Override
    public List<communityCodeVo> getBelongingCommunity() {
        List<communityCodeVo> belongingCommunity = ybssAddressMapper.getBelongingCommunity();
        for (communityCodeVo communityCodeVo : belongingCommunity) {
            communityCodeVo.setChildren(ybssAddressMapper.getstreetRoadLan(communityCodeVo.getLeader()));
        }
        return belongingCommunity;
    }

    @Override
    public List<YbssAddress> getAddressIndex(String completeAddress) {
        return ybssAddressMapper.getAddressIndex(completeAddress);
    }

    @Override
    public List<YbssAddress> selectAll() {
        return ybssAddressMapper.selectAll();
    }

    @Override
    public List<YbssAddress> getTreeIndex(String strid) {
        return ybssAddressMapper.getTreeIndex(strid);
    }

    @Override
    public int updatelist(YbssAddress ybssAddress) {
        return ybssAddressMapper.updatelist(ybssAddress);
    }

    @Override
    public int getdeleteById(String ybssId) {
        return ybssAddressMapper.getdeleteById(ybssId);
    }

    @Override
    public List<YbssAddress> selectBybelongingCommunity() {
        return ybssAddressMapper.selectBybelongingCommunity();
    }

    @Override
    public int insertdatalist(YbssAddress ybssAddress) {
        return ybssAddressMapper.insertdatalist(ybssAddress);
    }
}
